**************************************************
**************************************************
* REGRESSIONS
**************************************************
**************************************************
use "masterfile-in-geo-beats-for-analyses.dta", clear

**************************************************
* Graph settings
**************************************************
local plotformat   scheme(s1mono) plotregion(lcolor(none))
local yline        yline(0, lwidth(.3) lpattern(dash) lcolor(black))
local keep         keep(cri_*)
local legendops    rows(1) region(lwidth(none))
local msize        2
local levels       99
local fontsize     medium
local ciformat     lwidth(.3) recast(rcap) lpatt(solid)

**************************************************
* Relabel lag and lead treatment variables
**************************************************
foreach var of varlist *_3wa {
	lab var  `var' "-3w"
}
foreach var of varlist *_2wa {
	lab var `var' "-2w"
}
foreach var of varlist *_1wa {
	lab var `var' "-1w"
}
foreach var of varlist *_3wb {
	lab var  `var' "+3w"
}
foreach var of varlist *_2wb {
	lab var `var' "+2w"
}
foreach var of varlist *_1wb {
	lab var `var' "+1w"
}


**************************************************
* UOF by Time
* Fixed effects: BSDM; cluster: assgn_unit
**************************************************
estimates clear

foreach outcome in uof {
    foreach civ in blk hsp wht  {
        foreach crime in hom sho {
            foreach off in white black hisp {

                * Run regression
                reghdfe ///
                    `outcome'_`civ' ///
                    cri_`crime'_q1_3wa cri_`crime'_q1_2wa cri_`crime'_q1_1wa ///
                    cri_`crime'_q1_1wb cri_`crime'_q1_2wb cri_`crime'_q1_3wb ///
                    if off_race == "`off'", ///
                    absorb(bsdm) cluster(assgn_unit)

                estimates store `outcome'_`civ'_`off'_`crime'

            }

            * Plot coefficients
            coefplot ///
			    (`outcome'_`civ'_black_`crime', ///
                    msymbol(S)   mlcolor(blue)  mfcolor(blue*.3)  ciopts(`ciformat' lcol(blue*.5))) ///
                (`outcome'_`civ'_hisp_`crime',  ///
                    msymbol(O)   mlcolor(green) mfcolor(green*.3) ciopts(`ciformat' lcol(green*.5))) ///
                (`outcome'_`civ'_white_`crime', ///
                    msymbol(D)   mlcolor(red)   mfcolor(red*.3)   ciopts(`ciformat' lcol(red*.5)))  ///
                , `plotformat' vertical `keep' ///
                  msize(`msize') levels(`levels') ///
                  grid(between glcolor(gray) glpattern(dash)) `yline' ///
                  xlabel(, labsize(`fontsize')) ///
                  ylabel(-2(2)4, labsize(`fontsize')) ///
                  legend(order(2 "Black off." 4 "Hispanic off." 6 "White off.") ///
                         `legendops' size(`fontsize')) ///
                  xtitle("Weeks relative to a crime within 1/8th of a mile from home", ///
                         size(`fontsize')) ///
                  ytitle("Percentage point change", size(`fontsize')) ///
                  title(" ", size(`fontsize'))

           graph export ///
                "`outcome'-`civ'-`crime'-100-by-time-all-`off'.pdf", replace

        }
    }
}



**************************************************
* UOF by Time
* Fixed effects: Officer; cluster: assgn_unit
**************************************************
estimates clear

* Run UOF regressions by civilian race, crime, and officer race
foreach outcome in uof {
    foreach civ in blk hsp wht {
        foreach crime in hom sho {
            foreach off in white black hisp {
                reghdfe ///
                    `outcome'_`civ' ///
                    cri_`crime'_q1_3wa cri_`crime'_q1_2wa cri_`crime'_q1_1wa ///
                    cri_`crime'_q1_1wb cri_`crime'_q1_2wb cri_`crime'_q1_3wb ///
                    if off_race == "`off'", ///
                    absorb(uid) cluster(assgn_unit)
                estimates store `outcome'_`civ'_`off'_`crime'
            }

            * Plot coefficients
            coefplot ///
                (`outcome'_`civ'_white_`crime', ///
                    msymbol(D) mlcolor(red)   mfcolor(red*.3)   ciopts(`ciformat' lcol(red*.5))) ///
                (`outcome'_`civ'_hisp_`crime',  ///
                    msymbol(O) mlcolor(green) mfcolor(green*.3) ciopts(`ciformat' lcol(green*.5))) ///
                (`outcome'_`civ'_black_`crime', ///
                    msymbol(S) mlcolor(blue)  mfcolor(blue*.3)  ciopts(`ciformat' lcol(blue*.5))) ///
                , `plotformat' vertical `keep' ///
                  msize(`msize') levels(`levels') ///
                  grid(between glcolor(gray) glpattern(dash)) `yline' ///
                  xlabel(, labsize(`fontsize')) ///
                  ylabel(-1(1)3, labsize(`fontsize')) ///
                  legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                         `legendops' size(`fontsize')) ///
                  xtitle("Weeks relative to a homicide within 1/8th of a mile from home", ///
                         size(`fontsize')) ///
                  ytitle("Percentage point change", size(`fontsize')) ///
                  title("", size(`fontsize'))

            graph export ///
                "`outcome'-`civ'-`crime'-by-time-officer-fe-`off'.pdf", replace
        }
    }
}

**************************************************
* Arrests & Stops by Time
* Fixed effects: BSDM; cluster: assgn_unit
**************************************************

estimates clear

* Run stops and arrests regressions
foreach outcome in stp arr {
    foreach civ in blk hsp wht {
        foreach crime in hom sho {
            foreach off in white black hisp {
                reghdfe ///
                    `outcome'_`civ' ///
                    cri_`crime'_q1_3wa cri_`crime'_q1_2wa cri_`crime'_q1_1wa ///
                    cri_`crime'_q1_1wb cri_`crime'_q1_2wb cri_`crime'_q1_3wb ///
                    if off_race == "`off'", ///
                    absorb(bsdm) cluster(assgn_unit)
                estimates store `outcome'_`civ'_`off'_`crime'
            }

            coefplot ///
                (`outcome'_`civ'_white_`crime', ///
                    msymbol(D) mlcolor(red)   mfcolor(red*.3)   ciopts(`ciformat' lcol(red*.5))) ///
                (`outcome'_`civ'_hisp_`crime',  ///
                    msymbol(O) mlcolor(green) mfcolor(green*.3) ciopts(`ciformat' lcol(green*.5))) ///
                (`outcome'_`civ'_black_`crime', ///
                    msymbol(S) mlcolor(blue)  mfcolor(blue*.3)  ciopts(`ciformat' lcol(blue*.5))) ///
                , `plotformat' vertical `keep' ///
                  msize(`msize') levels(`levels') ///
                  grid(between glcolor(gray) glpattern(dash)) `yline' ///
                  xlabel(, labsize(`fontsize')) ///
                  ylabel(, labsize(`fontsize')) ///
                  legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                         `legendops' size(`fontsize')) ///
                  xtitle("Weeks relative to a homicide within 1/8th of a mile from home", ///
                         size(`fontsize')) ///
                  ytitle("Change in events per 100 working days", size(`fontsize')) ///
                  title("", size(`fontsize'))

            graph export ///
                "`outcome'-`civ'-`crime'-by-time.pdf", replace
        }
    }
}

* Weapon-related arrests
foreach outcome in arrweap {
    foreach civ in blk hsp wht {
        foreach crime in hom sho {
            foreach off in white black hisp {
                reghdfe ///
                    `outcome'_`civ' ///
                    cri_`crime'_q1_3wa cri_`crime'_q1_2wa cri_`crime'_q1_1wa ///
                    cri_`crime'_q1_1wb cri_`crime'_q1_2wb cri_`crime'_q1_3wb ///
                    if off_race == "`off'", ///
                    absorb(bsdm) cluster(assgn_unit)
                estimates store `outcome'_`civ'_`off'_`crime'
            }

            coefplot ///
                (`outcome'_`civ'_white_`crime', ///
                    msymbol(D) mlcolor(red)   mfcolor(red*.3)   ciopts(`ciformat' lcol(red*.5))) ///
                (`outcome'_`civ'_hisp_`crime',  ///
                    msymbol(O) mlcolor(green) mfcolor(green*.3) ciopts(`ciformat' lcol(green*.5))) ///
                (`outcome'_`civ'_black_`crime', ///
                    msymbol(S) mlcolor(blue)  mfcolor(blue*.3)  ciopts(`ciformat' lcol(blue*.5))) ///
                , `plotformat' vertical `keep' ///
                  msize(`msize') levels(`levels') ///
                  grid(between glcolor(gray) glpattern(dash)) `yline' ///
                  xlabel(, labsize(`fontsize')) ///
                  ylabel(, labsize(`fontsize')) ///
                  legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                         `legendops' size(`fontsize')) ///
                  xtitle("Weeks relative to a homicide within 1/8th of a mile from home", ///
                         size(`fontsize')) ///
                 ytitle("Change in events per 100 working days", size(`fontsize')) ///
                  title("", size(`fontsize'))

            graph export ///
                "`outcome'-`civ'-`crime'-by-time-weap.pdf", replace
        }
    }
}


**************************************************
* UOF by distance
* Fixed effects: BSDM; cluster: assgn_unit
**************************************************

*— Label distance bins —*
foreach var of varlist *q1* {
	lab var  `var' "0 to 1/8 mi"
}
foreach var of varlist *q2* {
	lab var `var' "1/8 to 1/4 mi"
}
foreach var of varlist *q3* {
	lab var `var' "1/4 to 3/8 mi"
}
foreach var of varlist *q4* {
	lab var  `var' "3/8 to 1/2 mi"
}
foreach var of varlist *q5* {
	lab var `var' "5/8 mi"
}
foreach var of varlist *q6* {
	lab var `var' "3/4 mi"
}

foreach var of varlist *q7* {
	lab var `var' "7/8 mi"
}

foreach var of varlist *q8* {
	lab var `var' "1 mi mi"
}


estimates clear

foreach o in uof {
    foreach r in blk hsp wht {
        foreach c in hom sho {
            foreach off in white black hisp {

                reghdfe `o'_`r'  ///
                    cri_`c'_q1_1wb cri_`c'_q2_1wb cri_`c'_q3_1wb cri_`c'_q4_1wb  ///
                    if off_race=="`off'", absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'

            }
            coefplot ///
                (`o'_`r'_white_`c', msymbol(D) mlcolor(red) mfcolor(red*.3) ///
                    ciopts(`ciformat' lcol(red*.5))) ///
                (`o'_`r'_hisp_`c',  msymbol(O) mlcolor(green) mfcolor(green*.3) ///
                    ciopts(`ciformat' lcol(green*.5))) ///
                (`o'_`r'_black_`c', msymbol(S) mlcolor(blue) mfcolor(blue*.3) ///
                    ciopts(`ciformat' lcol(blue*.5))) ///
                , `plotformat' vertical `keep' ///
                  msize(`msize') levels(`levels') ///
                  grid(between glcolor(gray) glpattern(dash)) `yline' ///
                  xlabel(, labsize(`fontsize')) ///
                  ylabel(-1(1)4, labsize(`fontsize')) ///
                  legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                         `legendops' size(`fontsize')) ///
                  xtitle("Distance from the officer's residence to the homicide location", size(`fontsize')) ///
                  ytitle("Change in events per 100 working days", size(`fontsize')) ///
                  title("", size(`fontsize'))

            graph export "`o'-`r'-`c'-100-by-distance-all.pdf", replace
        }
    }
}

**************************************************
* UOF by distance, North vs. South
* Fixed effects: BSDM; cluster: assgn_unit
**************************************************

*— Northside (CA ≤ 30) —*
estimates clear
foreach o in uof {
    foreach r in blk hsp wht {
        foreach c in hom sho {
            foreach off in white black hisp {

                reghdfe `o'_`r'  ///
                    cri_`c'_q1_1wb cri_`c'_q2_1wb cri_`c'_q3_1wb cri_`c'_q4_1wb  ///
                    if off_race=="`off'" & add_ca_num<=30, absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'

            }
            coefplot ///
                (`o'_`r'_white_`c', msymbol(D) mlcolor(red) mfcolor(red*.3) ///
                    ciopts(`ciformat' lcol(red*.5))) ///
                (`o'_`r'_hisp_`c',  msymbol(O) mlcolor(green) mfcolor(green*.3) ///
                    ciopts(`ciformat' lcol(green*.5))) ///
                (`o'_`r'_black_`c', msymbol(S) mlcolor(blue) mfcolor(blue*.3) ///
                    ciopts(`ciformat' lcol(blue*.5))) ///
                , `plotformat' vertical `keep' ///
                  msize(`msize') levels(`levels') ///
                  grid(between glcolor(gray) glpattern(dash)) `yline' ///
                  xlabel(, labsize(`fontsize')) ///
                  ylabel(-1(1)4, labsize(`fontsize')) ///
                  legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                         `legendops' size(`fontsize')) ///
                  xtitle("Distance from the officer's residence to the homicide location", size(`fontsize')) ///
                  ytitle("Change in events per 100 working days", size(`fontsize')) ///
                  title("Northside (CA ≤ 30)", size(`fontsize'))

            graph export "`o'-`r'-`c'-100-by-distance-north-all.pdf", replace
        }
    }
}

*— Southside (CA > 30) —*
foreach o in uof {
    foreach r in blk hsp wht {
        foreach c in hom sho {
            foreach off in white black hisp {

                reghdfe `o'_`r'  ///
                    cri_`c'_q1_1wb cri_`c'_q2_1wb cri_`c'_q3_1wb cri_`c'_q4_1wb  ///
                    if off_race=="`off'" & add_ca_num>30, absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'

            }
            coefplot ///
                (`o'_`r'_white_`c', msymbol(D) mlcolor(red) mfcolor(red*.3) ///
                    ciopts(`ciformat' lcol(red*.5))) ///
                (`o'_`r'_hisp_`c',  msymbol(O) mlcolor(green) mfcolor(green*.3) ///
                    ciopts(`ciformat' lcol(green*.5))) ///
                (`o'_`r'_black_`c', msymbol(S) mlcolor(blue) mfcolor(blue*.3) ///
                    ciopts(`ciformat' lcol(blue*.5))) ///
                , `plotformat' vertical `keep' ///
                  msize(`msize') levels(`levels') ///
                  grid(between glcolor(gray) glpattern(dash)) `yline' ///
                  xlabel(, labsize(`fontsize')) ///
                  ylabel(-1(1)4, labsize(`fontsize')) ///
                  legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                         `legendops' size(`fontsize')) ///
                  xtitle("Distance from the officer's residence to the homicide location", size(`fontsize')) ///
                  ytitle("Change in events per 100 working days", size(`fontsize')) ///
                  title("Southside (CA > 30)", size(`fontsize'))

            graph export "`o'-`r'-`c'-100-by-distance-south-all.pdf", replace
        }
    }
}



**************************************************
* UOF by distance, officer lives outside / inside district
* Fixed effects: BSDM; cluster: uid
**************************************************

estimates clear

foreach o in uof {
    foreach r in blk hsp wht {
        foreach c in hom sho {
            foreach off in white black hisp {
                reghdfe `o'_`r'  ///
                    cri_`c'_q1_1wb cri_`c'_q2_1wb cri_`c'_q3_1wb cri_`c'_q4_1wb  ///
                    if off_race=="`off'" & off_lives_district==0, ///
                    absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'
            }
            coefplot ///
                (`o'_`r'_white_`c', msymbol(D) mlcolor(red) mfcolor(red*.3) ciopts(`ciformat' lcol(red*.5))) ///
                (`o'_`r'_hisp_`c',  msymbol(O) mlcolor(green) mfcolor(green*.3) ciopts(`ciformat' lcol(green*.5))) ///
                (`o'_`r'_black_`c', msymbol(S) mlcolor(blue) mfcolor(blue*.3) ciopts(`ciformat' lcol(blue*.5))) ///
                , `plotformat' vertical `keep' ///
                  msize(`msize') levels(`levels') ///
                  grid(between glcolor(gray) glpattern(dash)) `yline' ///
                  xlabel(, labsize(`fontsize')) ylabel(-1(1)4, labsize(`fontsize')) ///
                  legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                         `legendops' size(`fontsize')) ///
                  xtitle("Distance from the officer's residence to the homicide location", size(`fontsize')) ///
                  ytitle("Change in events per 100 working days", size(`fontsize')) ///
                  title("", size(`fontsize'))
            graph export "`o'-`r'-`c'-100-by-distance-lives-outside-district-all.pdf", replace
        }
    }
}

foreach o in uof {
    foreach r in blk hsp wht {
        foreach c in hom sho {
            foreach off in white black hisp {
                reghdfe `o'_`r'  ///
                    cri_`c'_q1_1wb cri_`c'_q2_1wb cri_`c'_q3_1wb cri_`c'_q4_1wb  ///
                    if off_race=="`off'" & off_lives_district==1, ///
                    absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'
            }
            coefplot ///
                (`o'_`r'_white_`c', msymbol(D) mlcolor(red) mfcolor(red*.3) ciopts(`ciformat' lcol(red*.5))) ///
                (`o'_`r'_hisp_`c',  msymbol(O) mlcolor(green) mfcolor(green*.3) ciopts(`ciformat' lcol(green*.5))) ///
                (`o'_`r'_black_`c', msymbol(S) mlcolor(blue) mfcolor(blue*.3) ciopts(`ciformat' lcol(blue*.5))) ///
                , `plotformat' vertical `keep' ///
                  msize(`msize') levels(`levels') ///
                  grid(between glcolor(gray) glpattern(dash)) `yline' ///
                  xlabel(, labsize(`fontsize')) ylabel(-1(1)4, labsize(`fontsize')) ///
                  legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                         `legendops' size(`fontsize')) ///
                  xtitle("Distance from the officer's residence to the homicide location", size(`fontsize')) ///
                  ytitle("Change in events per 100 working days", size(`fontsize')) ///
                  title("", size(`fontsize'))
            graph export "`o'-`r'-`c'-100-by-distance-lives-inside-district-all.pdf", replace
        }
    }
}

**************************************************
* UOF by distance, officer FE
* Fixed effects: officer (uid); cluster: assgn_unit
**************************************************

estimates clear

foreach o in uof {
    foreach r in blk hsp wht {
        foreach c in hom sho {
            foreach off in white black hisp {
                reghdfe `o'_`r'  ///
                    cri_`c'_q1_1wb cri_`c'_q2_1wb cri_`c'_q3_1wb cri_`c'_q4_1wb  ///
                    if off_race=="`off'", ///
                    absorb(uid) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'
            }
            coefplot ///
                (`o'_`r'_white_`c', msymbol(D) mlcolor(red) mfcolor(red*.3) ciopts(`ciformat' lcol(red*.5))) ///
                (`o'_`r'_hisp_`c',  msymbol(O) mlcolor(green) mfcolor(green*.3) ciopts(`ciformat' lcol(green*.5))) ///
                (`o'_`r'_black_`c', msymbol(S) mlcolor(blue) mfcolor(blue*.3) ciopts(`ciformat' lcol(blue*.5))) ///
                , `plotformat' vertical `keep' ///
                  msize(`msize') levels(`levels') ///
                  grid(between glcolor(gray) glpattern(dash)) `yline' ///
                  xlabel(, labsize(`fontsize')) ylabel(-1(1)4, labsize(`fontsize')) ///
                  legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                         `legendops' size(`fontsize')) ///
                  xtitle("Distance from the officer's residence to the homicide location", size(`fontsize')) ///
                  ytitle("Change in events per 100 working days", size(`fontsize')) ///
                  title("", size(`fontsize'))
            graph export "`o'-`r'-`c'-100-by-distance-all-officer-fe.pdf", replace
        }
    }
}


**************************************************
* UOF by distance in multi-year periods
* Fixed effects: BSDM; cluster: assgn_unit
**************************************************

*— Define multi-year groups —*
gen years3 = "1214" if inlist(assgn_year,2012,2013,2014)
replace years3 = "1517" if inlist(assgn_year,2015,2016,2017)
replace years3 = "1820" if inlist(assgn_year,2018,2019,2020)

gen years5 = "1215" if inlist(assgn_year,2012,2013,2014,2015)
replace years5 = "1620" if inlist(assgn_year,2016,2017,2018,2019,2020)

estimates clear

foreach o in uof {
    foreach y in 1215 1620 {
        foreach c in hom sho {
            foreach off in white black hisp {
                reghdfe `o'_blk  ///
                    cri_`c'_q1_1wb cri_`c'_q2_1wb cri_`c'_q3_1wb cri_`c'_q4_1wb  ///
                    if off_race=="`off'" & years5=="`y'" , ///
                    absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`off'_`c'_`y'
            }
            coefplot ///
                (`o'_white_`c'_`y', msymbol(D) mlcolor(red)   mfcolor(red*.3)   ciopts(`ciformat' lcol(red*.5))) ///
                (`o'_hisp_`c'_`y',  msymbol(O) mlcolor(green) mfcolor(green*.3) ciopts(`ciformat' lcol(green*.5))) ///
                (`o'_black_`c'_`y', msymbol(S) mlcolor(blue)  mfcolor(blue*.3)  ciopts(`ciformat' lcol(blue*.5))) ///
                , `plotformat' vertical `keep' ///
                  msize(`msize') levels(`levels') ///
                  grid(between glcolor(gray) glpattern(dash)) `yline' ///
                  xlabel(, labsize(`fontsize')) ylabel(-1(1)4, labsize(`fontsize')) ///
                  legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                         `legendops' size(`fontsize')) ///
                  xtitle("Distance from the officer's residence to the homicide location", size(`fontsize')) ///
                  ytitle("Change in events per 100 working days", size(`fontsize')) ///
                  title("", size(`fontsize'))
            graph export "`o'-blk-`c'-100-by-distance-all-years-`y'-`off'.pdf", replace
        }
    }
}


**************************************************
* UOF by distance by semester
* Fixed effects: BSDM; cluster: assgn_unit
**************************************************
*— Define semesters —*
gen semester = "APRSEP" if inrange(assgn_month,4,9)
replace semester = "OCTMAR" if inlist(assgn_month,1,2,3,10,11,12)

estimates clear

foreach o in uof {
    foreach s in APRSEP OCTMAR {
        foreach c in hom sho {
            foreach off in white black hisp {
                reghdfe `o'_blk  ///
                    cri_`c'_q1_1wb cri_`c'_q2_1wb cri_`c'_q3_1wb cri_`c'_q4_1wb  ///
                    if off_race=="`off'" & semester=="`s'" , ///
                    absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`off'_`c'_`s'
            }
            coefplot ///
                (`o'_white_`c'_`s', msymbol(D) mlcolor(red)   mfcolor(red*.3)   ciopts(`ciformat' lcol(red*.5))) ///
                (`o'_hisp_`c'_`s',  msymbol(O) mlcolor(green) mfcolor(green*.3) ciopts(`ciformat' lcol(green*.5))) ///
                (`o'_black_`c'_`s', msymbol(S) mlcolor(blue)  mfcolor(blue*.3)  ciopts(`ciformat' lcol(blue*.5))) ///
                , `plotformat' vertical `keep' ///
                  msize(`msize') levels(`levels') ///
                  grid(between glcolor(gray) glpattern(dash)) `yline' ///
                  xlabel(, labsize(`fontsize')) ylabel(-1(1)4, labsize(`fontsize')) ///
                  legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                         `legendops' size(`fontsize')) ///
                  xtitle("Distance from the officer's residence to the homicide location", size(`fontsize')) ///
                  ytitle("Change in events per 100 working days", size(`fontsize')) ///
                  title("", size(`fontsize'))
            graph export "`o'-blk-`c'-100-by-distance-all-semester-`s'-`off'.pdf", replace
        }
    }
}


**************************************************
* UOF by distance by weekday/weekend
* Fixed effects: BSDM; cluster: assgn_unit
**************************************************
*— Define weekday vs weekend —*
gen weekday = cond(inlist(assgn_dow,1,2,3), "wkday", "wkend")

estimates clear

foreach o in uof {
    foreach s in wkday wkend {
        foreach c in hom sho {
            foreach off in white black hisp {
                reghdfe `o'_blk ///
                    cri_`c'_q1_1wb cri_`c'_q2_1wb cri_`c'_q3_1wb cri_`c'_q4_1wb ///
                    if off_race=="`off'" & weekday=="`s'", ///
                    absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`off'_`c'_`s'
            }
            coefplot ///
                (`o'_white_`c'_`s', msymbol(D) mlcolor(red)   mfcolor(red*.3)   ciopts(`ciformat' lcol(red*.5))) ///
                (`o'_hisp_`c'_`s',  msymbol(O) mlcolor(green) mfcolor(green*.3) ciopts(`ciformat' lcol(green*.5))) ///
                (`o'_black_`c'_`s', msymbol(S) mlcolor(blue)  mfcolor(blue*.3)  ciopts(`ciformat' lcol(blue*.5))) ///
                , `plotformat' vertical `keep' ///
                  msize(`msize') levels(`levels') ///
                  grid(between glcolor(gray) glpattern(dash)) `yline' ///
                  xlabel(, labsize(`fontsize')) ylabel(-1(1)4, labsize(`fontsize')) ///
                  legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                         `legendops' size(`fontsize')) ///
                  xtitle("Distance from the officer's residence to the homicide location", size(`fontsize')) ///
                  ytitle("Change in events per 100 working days", size(`fontsize')) ///
                  title("", size(`fontsize'))
            graph export "`o'-blk-`c'-100-by-distance-all-`s'-`off'.pdf", replace
        }
    }
}


**************************************************
* UOF by suspect race (BSDM FE)
**************************************************

estimates clear

foreach o in uof {
    foreach r in blk {
        foreach c in hom sho {
            foreach off in white black hisp {
                reghdfe `o'_`r' ///
                    cri_`c'_q1_p_blk_1wb cri_`c'_q1_p_hsp_1wb cri_`c'_q1_p_wht_1wb cri_`c'_q1_p_unk_1wb ///
                    if off_race=="`off'", absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'
                
                coefplot (`o'_`r'_`off'_`c', ///
                    msymbol(O) mlcolor("86 180 233") mfcolor("86 180 233"*.3) ///
                    ciopts(`ciformat' lcol("86 180 233"*.5))) ///
                    , `plotformat' `keep' ///
                      order( cri_`c'_q1_p_blk_1wb cri_`c'_q1_p_hsp_1wb cri_`c'_q1_p_wht_1wb cri_`c'_q1_p_unk_1wb ) ///
                      msize(`msize') levels(`levels') `xline' omitted ///
                      xlabel(-5(5)15, labsize(`fontsize')) legend(off) ///
                      title("UOF against Black", size(`fontsize')) ///
                      xtitle("Percentage point change", size(`fontsize'))
                graph export "`o'-`r'-`c'-100-by-perpetrator-`off'-officers.pdf", replace
            }
        }
    }
}


**************************************************
* UOF by victim–suspect race
* Fixed effects: BSDM; cluster: assgn_unit (and uid for officer FE)
**************************************************

*— Label suspect race bins —*
foreach var of varlist *_p_blk_1wb {
	lab var  `var' "Black susp."
}

foreach var of varlist *_p_wht_1wb {
	lab var  `var' "White susp."
}


foreach var of varlist *_p_hsp_1wb {
	lab var  `var' "Hispanic susp."
}


foreach var of varlist *_p_unk_1wb {
	lab var  `var' "No arrest made"
}

*— BSDM FE, cluster by unit —*
estimates clear
foreach o in uof {
    foreach r in blk {
        foreach c in hom sho {
            foreach off in white black hisp {
                reghdfe `o'_`r' ///
                    cri_`c'_q1_v_blk_p_blk_1wb cri_`c'_q1_v_blk_p_hsp_1wb ///
                    cri_`c'_q1_v_blk_p_wht_1wb cri_`c'_q1_v_blk_p_unk_1wb ///
                    cri_`c'_q1_v_hsp_p_blk_1wb cri_`c'_q1_v_hsp_p_hsp_1wb ///
                    cri_`c'_q1_v_hsp_p_wht_1wb cri_`c'_q1_v_hsp_p_unk_1wb ///
                    cri_`c'_q1_v_wht_p_blk_1wb cri_`c'_q1_v_wht_p_hsp_1wb ///
                    cri_`c'_q1_v_wht_p_wht_1wb cri_`c'_q1_v_wht_p_unk_1wb ///
                    if off_race=="`off'", absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'

                coefplot (`o'_`r'_`off'_`c', ///
                    msymbol(O) mlcolor("86 180 233") mfcolor("86 180 233"*.3) ///
                    ciopts(`ciformat' lcol("86 180 233"*.5))) ///
                    , `plotformat' `keep' ///
                      order( ///  
                        cri_`c'_q1_v_blk_p_blk_1wb cri_`c'_q1_v_blk_p_hsp_1wb ///  
                        cri_`c'_q1_v_blk_p_wht_1wb cri_`c'_q1_v_blk_p_unk_1wb ///  
                        cri_`c'_q1_v_hsp_p_blk_1wb cri_`c'_q1_v_hsp_p_hsp_1wb ///  
                        cri_`c'_q1_v_hsp_p_wht_1wb cri_`c'_q1_v_hsp_p_unk_1wb ///  
                        cri_`c'_q1_v_wht_p_blk_1wb cri_`c'_q1_v_wht_p_hsp_1wb ///  
                        cri_`c'_q1_v_wht_p_wht_1wb cri_`c'_q1_v_wht_p_unk_1wb) ///
                      msize(`msize') levels(`levels') `xline' omitted ///
                      xlabel(-5(5)15, labsize(`fontsize')) legend(off) ///
                      title("UOF against Black", size(`fontsize')) ///
                      xtitle("Percentage point change", size(`fontsize')) ///
                      headings( ///  
                        cri_`c'_q1_v_blk_p_blk_1wb = "{bf:Black victim}" ///  
                        cri_`c'_q1_v_hsp_p_blk_1wb = "{bf:Hispanic victim}" ///  
                        cri_`c'_q1_v_wht_p_blk_1wb = "{bf:White victim}") 

                graph export "`o'-`r'-`c'-100-by-victim-by-perp-`off'.pdf", replace
            }
        }
    }
}

*— Officer FE , cluster by unit —*
estimates clear
foreach o in uof {
    foreach r in blk {
        foreach c in hom sho {
            foreach off in white black hisp {
                reghdfe `o'_`r' ///
                    cri_`c'_q1_v_blk_p_blk_1wb cri_`c'_q1_v_blk_p_hsp_1wb ///
                    cri_`c'_q1_v_blk_p_wht_1wb cri_`c'_q1_v_blk_p_unk_1wb ///
                    cri_`c'_q1_v_hsp_p_blk_1wb cri_`c'_q1_v_hsp_p_hsp_1wb ///
                    cri_`c'_q1_v_hsp_p_wht_1wb cri_`c'_q1_v_hsp_p_unk_1wb ///
                    cri_`c'_q1_v_wht_p_blk_1wb cri_`c'_q1_v_wht_p_hsp_1wb ///
                    cri_`c'_q1_v_wht_p_wht_1wb cri_`c'_q1_v_wht_p_unk_1wb ///
                    if off_race=="`off'", absorb(uid) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'

                coefplot (`o'_`r'_`off'_`c', ///
                    msymbol(O) mlcolor("86 180 233") mfcolor("86 180 233"*.3) ///
                    ciopts(`ciformat' lcol("86 180 233"*.5))) ///
                    , `plotformat' `keep' ///
                      order( ///  
                        cri_`c'_q1_v_blk_p_blk_1wb cri_`c'_q1_v_blk_p_hsp_1wb ///  
                        cri_`c'_q1_v_blk_p_wht_1wb cri_`c'_q1_v_blk_p_unk_1wb ///  
                        cri_`c'_q1_v_hsp_p_blk_1wb cri_`c'_q1_v_hsp_p_hsp_1wb ///  
                        cri_`c'_q1_v_hsp_p_wht_1wb cri_`c'_q1_v_hsp_p_unk_1wb ///  
                        cri_`c'_q1_v_wht_p_blk_1wb cri_`c'_q1_v_wht_p_hsp_1wb ///  
                        cri_`c'_q1_v_wht_p_wht_1wb cri_`c'_q1_v_wht_p_unk_1wb) ///
                      msize(`msize') levels(`levels') `xline' omitted ///
                      xlabel(-5(5)15, labsize(`fontsize')) legend(off) ///
                      title("UOF against Black (Officer FE)", size(`fontsize')) ///
                      xtitle("Percentage point change", size(`fontsize')) ///
                      headings( ///  
                        cri_`c'_q1_v_blk_p_blk_1wb = "{bf:Black victim}" ///  
                        cri_`c'_q1_v_hsp_p_blk_1wb = "{bf:Hispanic victim}" ///  
                        cri_`c'_q1_v_wht_p_blk_1wb = "{bf:White victim}") 

                graph export "`o'-`r'-`c'-100-by-victim-by-perp-`off'-officerFE.pdf", replace
            }
        }
    }
}



**************************************************
* UOF victim - suspect race (BSDM FE): UOF with force and without injury
**************************************************

* Rename injury flags
ren uof_*_maf_nin uofnin_*
ren uof_*_maf_yin uofyin_*

estimates clear

foreach o in uofyin uofnin {
    foreach r in blk hsp wht {
        foreach c in hom sho {
            foreach off in white black hisp {

                * Estimate model *
                reghdfe `o'_`r'  ///
                    cri_`c'_q1_v_blk_p_blk_1wb cri_`c'_q1_v_blk_p_hsp_1wb /// 
                    cri_`c'_q1_v_blk_p_wht_1wb cri_`c'_q1_v_blk_p_unk_1wb /// 
                    cri_`c'_q1_v_hsp_p_blk_1wb cri_`c'_q1_v_hsp_p_hsp_1wb /// 
                    cri_`c'_q1_v_hsp_p_wht_1wb cri_`c'_q1_v_hsp_p_unk_1wb /// 
                    cri_`c'_q1_v_wht_p_blk_1wb cri_`c'_q1_v_wht_p_hsp_1wb /// 
                    cri_`c'_q1_v_wht_p_wht_1wb cri_`c'_q1_v_wht_p_unk_1wb /// 
                    if off_race=="`off'", absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'

                * Plot for White officers *
                coefplot (`o'_`r'_white_`c', ///
                    msymbol(D) mlcolor(red) mfcolor(red*.3) ///
                    ciopts(`ciformat' lcol(red*.5))) ///
                    , `plotformat' `keep' ///
                      order( ///
                        cri_`c'_q1_v_blk_p_blk_1wb cri_`c'_q1_v_blk_p_hsp_1wb ///
                        cri_`c'_q1_v_blk_p_wht_1wb cri_`c'_q1_v_blk_p_unk_1wb ///
                        cri_`c'_q1_v_hsp_p_blk_1wb cri_`c'_q1_v_hsp_p_hsp_1wb ///
                        cri_`c'_q1_v_hsp_p_wht_1wb cri_`c'_q1_v_hsp_p_unk_1wb ///
                        cri_`c'_q1_v_wht_p_blk_1wb cri_`c'_q1_v_wht_p_hsp_1wb ///
                        cri_`c'_q1_v_wht_p_wht_1wb cri_`c'_q1_v_wht_p_unk_1wb) ///
                      msize(`msize') levels(`levels') ///
                      `xline' omitted ///
                      xlabel(-5(5)15, labsize(`fontsize')) ///
                      legend(order(2 "White officers") `legendops' size(`fontsize')) ///
                      title(" ", size(`fontsize')) ///
                      headings( ///
                        cri_`c'_q1_v_blk_p_blk_1wb = "{bf:Black victim}"      ///
                        cri_`c'_q1_v_hsp_p_blk_1wb = "{bf:Hispanic victim}"   ///
                        cri_`c'_q1_v_wht_p_blk_1wb = "{bf:White victim}")
                graph export "`o'-`r'-`c'-100-by-perp-white.pdf", replace

                * Plot for Hispanic officers *
                coefplot (`o'_`r'_hisp_`c', ///
                    msymbol(O) mlcolor(green) mfcolor(green*.3) ///
                    ciopts(`ciformat' lcol(green*.5))) ///
                    , `plotformat' `keep' ///
                      order( ///
                        cri_`c'_q1_v_blk_p_blk_1wb cri_`c'_q1_v_blk_p_hsp_1wb ///
                        cri_`c'_q1_v_blk_p_wht_1wb cri_`c'_q1_v_blk_p_unk_1wb ///
                        cri_`c'_q1_v_hsp_p_blk_1wb cri_`c'_q1_v_hsp_p_hsp_1wb ///
                        cri_`c'_q1_v_hsp_p_wht_1wb cri_`c'_q1_v_hsp_p_unk_1wb ///
                        cri_`c'_q1_v_wht_p_blk_1wb cri_`c'_q1_v_wht_p_hsp_1wb ///
                        cri_`c'_q1_v_wht_p_wht_1wb cri_`c'_q1_v_wht_p_unk_1wb) ///
                      msize(`msize') levels(`levels') ///
                      `xline' omitted ///
                      xlabel(-5(5)15, labsize(`fontsize')) ///
                      legend(order(2 "Hispanic officers") `legendops' size(`fontsize')) ///
                      title(" ", size(`fontsize')) ///
                      headings( ///
                        cri_`c'_q1_v_blk_p_blk_1wb = "{bf:Black victim}"      ///
                        cri_`c'_q1_v_hsp_p_blk_1wb = "{bf:Hispanic victim}"   ///
                        cri_`c'_q1_v_wht_p_blk_1wb = "{bf:White victim}")
                graph export "`o'-`r'-`c'-100-by-perp-hisp.pdf", replace

                * Plot for Black officers *
                coefplot (`o'_`r'_black_`c', ///
                    msymbol(S) mlcolor(blue) mfcolor(blue*.3) ///
                    ciopts(`ciformat' lcol(blue*.5))) ///
                    , `plotformat' `keep' ///
                      order( ///
                        cri_`c'_q1_v_blk_p_blk_1wb cri_`c'_q1_v_blk_p_hsp_1wb ///
                        cri_`c'_q1_v_blk_p_wht_1wb cri_`c'_q1_v_blk_p_unk_1wb ///
                        cri_`c'_q1_v_hsp_p_blk_1wb cri_`c'_q1_v_hsp_p_hsp_1wb ///
                        cri_`c'_q1_v_hsp_p_wht_1wb cri_`c'_q1_v_hsp_p_unk_1wb ///
                        cri_`c'_q1_v_wht_p_blk_1wb cri_`c'_q1_v_wht_p_hsp_1wb ///
                        cri_`c'_q1_v_wht_p_wht_1wb cri_`c'_q1_v_wht_p_unk_1wb) ///
                      msize(`msize') levels(`levels') ///
                      `xline' omitted ///
                      xlabel(-5(5)15, labsize(`fontsize')) ///
                      legend(order(2 "Black officers") `legendops' size(`fontsize')) ///
                      title(" ", size(`fontsize')) ///
                      headings( ///
                        cri_`c'_q1_v_blk_p_blk_1wb = "{bf:Black victim}"      ///
                        cri_`c'_q1_v_hsp_p_blk_1wb = "{bf:Hispanic victim}"   ///
                        cri_`c'_q1_v_wht_p_blk_1wb = "{bf:White victim}")
                graph export "`o'-`r'-`c'-100-by-perp-black.pdf", replace
            }
        }
    }
}



**************************************************
* UOF by distance, injury vs. noninjury
* FE: BSDM; cluster: assgn_unit
**************************************************

estimates clear

foreach o in uofyin uofnin {
    foreach r in blk hsp wht {
        foreach c in hom sho {
            foreach off in white black hisp {

                * Regression *
                reghdfe `o'_`r' ///
                    cri_`c'_q1_1wb cri_`c'_q2_1wb cri_`c'_q3_1wb cri_`c'_q4_1wb ///
                    if off_race=="`off'", ///
                    absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'

                * Coefficient plot *
                coefplot ///
                    (`o'_`r'_white_`c', msymbol(D) mlcolor(red) mfcolor(red*.3)     ///
                        ciopts(`ciformat' lcol(red*.5))) ///
                    (`o'_`r'_hisp_`c',  msymbol(O) mlcolor(green) mfcolor(green*.3) ///
                        ciopts(`ciformat' lcol(green*.5))) ///
                    (`o'_`r'_black_`c', msymbol(S) mlcolor(blue) mfcolor(blue*.3)  ///
                        ciopts(`ciformat' lcol(blue*.5))) ///
                    , `plotformat' `keep' vertical ///
                      msize(`msize') levels(`levels') ///
                      grid(between glcolor(gray) glpattern(dash)) ///
                      `yline' ///
                      xlabel(, labsize(`fontsize')) ///
                      ylabel(-1(1)4, labsize(`fontsize')) ///
                      legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                             `legendops' size(`fontsize')) ///
                      xtitle("Distance from the officer's residence to the homicide location", ///
                             size(`fontsize')) ///
                      ytitle("Change in events per 100 working days", ///
                             size(`fontsize')) ///
                      title("", size(`fontsize'))

                * Export graph *
                graph export "`o'-`r'-`c'-100-by-distance-all.pdf", replace
            }
        }
    }
}


**************************************************
* UOF by distance, passive / active resister
* FE: BSDM; cluster: assgn_unit
**************************************************

estimates clear

foreach o in uofactive uofpassive {
    foreach r in blk hsp wht {
        foreach c in hom sho {
            foreach off in white black hisp {

                * Regression *
                reghdfe `o'_`r' ///
                    cri_`c'_q1_1wb cri_`c'_q2_1wb cri_`c'_q3_1wb cri_`c'_q4_1wb ///
                    if off_race=="`off'", ///
                    absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'

                * Coefficient plot *
                coefplot ///
                    (`o'_`r'_white_`c', msymbol(D) mlcolor(red)   mfcolor(red*.3)   ciopts(`ciformat' lcol(red*.5))) ///
                    (`o'_`r'_hisp_`c',  msymbol(O) mlcolor(green) mfcolor(green*.3) ciopts(`ciformat' lcol(green*.5))) ///
                    (`o'_`r'_black_`c', msymbol(S) mlcolor(blue)  mfcolor(blue*.3)  ciopts(`ciformat' lcol(blue*.5))) ///
                    , `plotformat' `keep' vertical ///
                      msize(`msize') levels(`levels') ///
                      grid(between glcolor(gray) glpattern(dash)) ///
                      `yline' ///
                      xlabel(, labsize(`fontsize')) ///
                      ylabel(-1(1)4, labsize(`fontsize')) ///
                      legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                             `legendops' size(`fontsize')) ///
                      xtitle("Distance from the officer's residence to the homicide location", ///
                             size(`fontsize')) ///
                      ytitle("Change in events per 100 working days", ///
                             size(`fontsize')) ///
                      title("", size(`fontsize'))

                * Export graph *
                graph export "`o'-`r'-`c'-100-by-distance-all.pdf", replace
            }
        }
    }
}


**************************************************
* UOF by distance, single / multiple officer
* FE: bsdm; cluster: assgn_unit
**************************************************

estimates clear

foreach o in uofmultiple uofsingle {
    foreach r in blk hsp wht {
        foreach c in hom sho {
            foreach off in white black hisp {

                * Regression *
                reghdfe `o'_`r' ///
                    cri_`c'_q1_1wb cri_`c'_q2_1wb cri_`c'_q3_1wb cri_`c'_q4_1wb ///
                    if off_race=="`off'", ///
                    absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'

                * Coefficient plot *
                coefplot ///
                    (`o'_`r'_white_`c', msymbol(D) mlcolor(red)   mfcolor(red*.3)   ciopts(`ciformat' lcol(red*.5))) ///
                    (`o'_`r'_hisp_`c',  msymbol(O) mlcolor(green) mfcolor(green*.3) ciopts(`ciformat' lcol(green*.5))) ///
                    (`o'_`r'_black_`c', msymbol(S) mlcolor(blue)  mfcolor(blue*.3)  ciopts(`ciformat' lcol(blue*.5))) ///
                    , `plotformat' `keep' vertical ///
                      msize(`msize') levels(`levels') ///
                      grid(between glcolor(gray) glpattern(dash)) ///
                      `yline' ///
                      xlabel(, labsize(`fontsize')) ///
                      ylabel(-2(2)8, labsize(`fontsize')) ///
                      legend(order(2 "White off." 4 "Hispanic off." 6 "Black off.") ///
                             `legendops' size(`fontsize')) ///
                      xtitle("Distance from the officer's residence to the homicide location", ///
                             size(`fontsize')) ///
                      ytitle("Change in events per 100 working days", ///
                             size(`fontsize')) ///
                      title("", size(`fontsize'))

                * Export graph *
                graph export "`o'-`r'-`c'-100-by-distance-all.pdf", replace
            }
        }
    }
}

**************************************************
* Victim - Suspect race (BSDM FE)
* FE: BSDM; cluster: assgn_unit
**************************************************
estimates clear

foreach o in uofactive uofpassive {
    foreach r in blk hsp wht {
        foreach c in hom {
            foreach off in white {

                * Regression *
                reghdfe `o'_`r' ///
                    cri_`c'_q1_v_blk_p_blk_1wb cri_`c'_q1_v_blk_p_hsp_1wb ///
                    cri_`c'_q1_v_blk_p_wht_1wb cri_`c'_q1_v_blk_p_unk_1wb ///
                    cri_`c'_q1_v_hsp_p_blk_1wb cri_`c'_q1_v_hsp_p_hsp_1wb ///
                    cri_`c'_q1_v_hsp_p_wht_1wb cri_`c'_q1_v_hsp_p_unk_1wb ///
                    cri_`c'_q1_v_wht_p_blk_1wb cri_`c'_q1_v_wht_p_hsp_1wb ///
                    cri_`c'_q1_v_wht_p_wht_1wb cri_`c'_q1_v_wht_p_unk_1wb ///
                    if off_race=="`off'", ///
                    absorb(bsdm) cluster(assgn_unit)
                estimates store `o'_`r'_`off'_`c'

                * Coefficient plot *
                coefplot ///
                    (`o'_`r'_white_`c', msymbol(O) mlcolor("86 180 233") ///
                                       mfcolor("86 180 233"*.3) ///
                                       ciopts(`ciformat' lcol("86 180 233"*.5))) ///
                    , `plotformat' `keep' ///
                      order( ///
                        cri_`c'_q1_v_blk_p_blk_1wb cri_`c'_q1_v_blk_p_hsp_1wb ///
                        cri_`c'_q1_v_blk_p_wht_1wb cri_`c'_q1_v_blk_p_unk_1wb ///
                        cri_`c'_q1_v_hsp_p_blk_1wb cri_`c'_q1_v_hsp_p_hsp_1wb ///
                        cri_`c'_q1_v_hsp_p_wht_1wb cri_`c'_q1_v_hsp_p_unk_1wb ///
                        cri_`c'_q1_v_wht_p_blk_1wb cri_`c'_q1_v_wht_p_hsp_1wb ///
                        cri_`c'_q1_v_wht_p_wht_1wb cri_`c'_q1_v_wht_p_unk_1wb) ///
                      msize(`msize') levels(`levels') ///
                      `xline' omitted ///
                      xlabel(-5(5)15, labsize(`fontsize')) ///
                      legend(off) ///
                      title("UOF Against Black", size(`fontsize')) ///
                      xtitle("Percentage point change", size(`fontsize')) ///
                      headings( ///
                        cri_`c'_q1_v_blk_p_blk_1wb = "{bf:Black victim}" ///
                        cri_`c'_q1_v_hsp_p_blk_1wb = "{bf:Hispanic victim}" ///
                        cri_`c'_q1_v_wht_p_blk_1wb = "{bf:White victim}")

                * Export graph *
                graph export "`o'-`r'-`c'-100-by-victim-by-perpetrator-white-officers.pdf", replace
            }
        }
    }
}
